﻿using System.Windows;
using MovieBuddy.Properties;

namespace MovieBuddy.Dialogs
{
    /// <summary>
    /// Interaction logic for MediaPlayerSetup.xaml
    /// </summary>
    public partial class MediaPlayerSetup : Window
    {
        public MediaPlayerSetup()
        {
            InitializeComponent();
            vlcPicker.FileName = Settings.Default.VLCLocation;
            vlcFiles.Text = Settings.Default.VLCFiles;
        }

        private void CancelPressed(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void SavePressed(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(vlcPicker.FileName))
            {
                Settings.Default.VLCLocation = vlcPicker.FileName;
            }
            Settings.Default.VLCFiles = vlcFiles.Text;
            Settings.Default.Save();
            Close();
        }
    }
}
